package com.colin.aiyi.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.colin.aiyi.R;
import com.colin.aiyi.adapter.SectionsPagerAdapter2;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.bingoogolapple.bgabanner.BGABanner;

@Deprecated
public class FramentOnesay extends Fragment {


    Unbinder unbinder;
    @BindView(R.id.banner_guide_content)
    BGABanner bannerGuideContent;
    @BindView(R.id.imageview)
    ImageView imageview;
    @BindView(R.id.text_title)
    TextView textTitle;
    @BindView(R.id.text_decs)
    TextView textDecs;

    @BindView(R.id.viewpager)
    ViewPager viewpager;
    @BindView(R.id.tablayout)
    TabLayout tablayout;
    private SectionsPagerAdapter2 mSectionsPagerAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.frament_onesay, null);
        unbinder = ButterKnife.bind(this, view);
        bannerGuideContent.setData(R.mipmap.a, R.mipmap.a, R.mipmap.a);
        for (int i = 0; i < 3; i++) {
            tablayout.addTab(tablayout.newTab().setText("ddd" + i));
        }


        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mSectionsPagerAdapter = new SectionsPagerAdapter2(getChildFragmentManager());
        viewpager.setAdapter(mSectionsPagerAdapter);
        viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tablayout));
        tablayout.setupWithViewPager(viewpager);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
